home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8352 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  57 lines

  1. Path: news.unt.edu!news
  2. From: Steve Fogoros <sfogoros@hsc.unt.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Borland in-line asm
  5. Date: Sun, 03 Mar 1996 09:31:17 -0800
  6. Organization: University of North Texas Health Science Center
  7. Message-ID: <3139D765.7E3B@hsc.unt.edu>
  8. References: <3139B06E.40C5@student.utwente.nl>
  9. NNTP-Posting-Host: sfogoros.hsc.unt.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Bas Broers wrote:
  16. > Maybe a simple question, but how can i define a label in BASM (borland in-line assambler).
  17. > For example this program
  18. > void main(void)
  19. > {
  20. >       asm {
  21. >       mov ax,0x0010
  22. >       mov cx,0x0010
  23. > next: inc ax
  24. >       loop next
  25. >       }
  26. > }
  27. > Gives the error: Undefined label next
  28. > Thanks: Bas Broers
  29.  
  30. Do this:
  31.  
  32.  void main(void)
  33.  {
  34.        asm {
  35.  
  36.        mov ax,0x0010
  37.        mov cx,0x0010
  38.        }
  39.  next:
  40.        asm {
  41.  
  42.        inc ax
  43.        loop next
  44.        }
  45.  }
  46.  
  47. You could also write '} next: asm {' on one line. (Tested with Borland 3.1)
  48. -- 
  49. Steve Fogoros, Academic Information Coordinator
  50. University of North Texas Health Science Center
  51. sfogoros@hsc.unt.edu
  52.